<%@ include file="htmlHead.jsp"%>
<%@ page import="com.glodon.paas.account.api.bean.User" %>
<link rel="stylesheet" type="text/css" href="${path}/css/userinfo.min.css" />
<%@ page pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<body>
	<div id="glodon_content_wrap">
		<%@ include file="header.jsp"%>
		<div class="hide fade in normal-modal" id="categoryModal">
			<div class="modal-wrap">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button"></button>
					<h3>请选择从事行业</h3>
				</div>
				<form id="categoryList">
					<div class="modal-body">
						<div class="control-group">
							<label class="checkbox inline span1" for="list1"> <input
								type="checkbox" value="option1" name="categoryList" id="list1">
								<div>土建</div> </label> <label class="checkbox inline span1" for="list2">
								<input type="checkbox" value="option2" name="categoryList"
								id="list2">
								<div>钢筋施工</div> </label> <label class="checkbox inline span1" for="list3">
								<input type="checkbox" value="option3" name="categoryList"
								id="list3">
								<div>装饰</div> </label> <label class="checkbox inline span1" for="list4">
								<input type="checkbox" value="option4" name="categoryList"
								id="list4">
								<div>仿古</div> </label> <label class="checkbox inline span1" for="list5">
								<input type="checkbox" value="option5" name="categoryList"
								id="list5">
								<div>电气</div> </label>
						</div>
	
						<div class="control-group">
							<label class="checkbox inline span1" for="list6"> <input
								type="checkbox" value="option6" name="categoryList" id="list6">
								<div>给排水</div> </label> <label class="checkbox inline span1" for="list7">
								<input type="checkbox" value="option7" name="categoryList"
								id="list7">
								<div>暖通</div> </label> <label class="checkbox inline span1" for="list8">
								<input type="checkbox" value="option8" name="categoryList"
								id="list8">
								<div>消防</div> </label> <label class="checkbox inline span1" for="list9">
								<input type="checkbox" value="option9" name="categoryList"
								id="list9">
								<div>市政工程</div> </label> <label class="checkbox inline span1"
								for="list10"> <input type="checkbox" value="option10"
								name="categoryList" id="list10">
								<div>园林</div> </label>
						</div>
	
						<div class="control-group">
							<label class="checkbox inline span1" for="list11"> <input
								type="checkbox" value="option11" name="categoryList" id="list11">
								<div>路桥隧道</div> </label> <label class="checkbox inline span1"
								for="list12"> <input type="checkbox" value="option12"
								name="categoryList" id="list12">
								<div>地铁</div> </label> <label class="checkbox inline span1" for="list13">
								<input type="checkbox" value="option13" name="categoryList"
								id="list13">
								<div>铁路工程</div> </label> <label class="checkbox inline span1"
								for="list14"> <input type="checkbox" value="option14"
								name="categoryList" id="list14">
								<div>工业厂房</div> </label> <label class="checkbox inline span1"
								for="list15"> <input type="checkbox" value="option15"
								name="categoryList" id="list15">
								<div>工艺管道</div> </label>
						</div>
	
						<div class="control-group">
							<label class="checkbox inline span1" for="list16"> <input
								type="checkbox" value="option16" name="categoryList" id="list16">
								<div>设备安装</div> </label> <label class="checkbox inline span1"
								for="list17"> <input type="checkbox" value="option17"
								name="categoryList" id="list17">
								<div>非标设安</div> </label> <label class="checkbox inline span1"
								for="list18"> <input type="checkbox" value="option18"
								name="categoryList" id="list18">
								<div>厂区管网</div> </label> <label class="checkbox inline span1"
								for="list19"> <input type="checkbox" value="option19"
								name="categoryList" id="list19">
								<div>水利水电</div> </label> <label class="checkbox inline span1"
								for="list20"> <input type="checkbox" value="option20"
								name="categoryList" id="list20">
								<div>电力工程</div> </label>
						</div>
	
						<div class="control-group">
							<label class="checkbox inline span1" for="list21"> <input
								type="checkbox" value="option21" name="categoryList" id="list21">
								<div>石油化工</div> </label> <label class="checkbox inline span1"
								for="list22"> <input type="checkbox" value="option22"
								name="categoryList" id="list22">
								<div>煤炭冶金</div> </label> <label class="checkbox inline span1"
								for="list23"> <input type="checkbox" value="option23"
								name="categoryList" id="list23">
								<div>民航</div> </label> <label class="checkbox inline span1" for="list24">
								<input type="checkbox" value="option24" name="categoryList"
								id="list24">
								<div>通信</div> </label> <label class="checkbox inline span1" for="list25">
								<input type="checkbox" value="option25" name="categoryList"
								id="list25">
								<div>港口</div> </label>
						</div>
						<div class="control-group">
							 <label class="checkbox inline span1" for="other">
								<input type="checkbox" value="option26" name="categoryList"
								id="other">
								<div>其他</div> 
						 	</label>
						</div>
					</div>
					<div class="modal-footer">
						<a class="btn btn-primary" href="#" style="color: #ffffff"
							id="categoryBtn">确定</a> <a data-dismiss="modal" class="btn"
							href="#" style="color: #333333">关闭</a>
					</div>
				</form>
			</div>
		</div>
		<div id="glodon_container">
			<div id="glodon_user_info">
				<ul class="nav nav-tabs" id="myTab">
					<li class="active"><a href="#info">个人设置</a>
					</li>
					<li><a href="#myspace">应用信息</a>
					</li>
					<li id="linkman_tab"><a href="#linkMan">联系人</a></li>
					<li id="organization_tab"><a href="#organization">组织</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active fade in" id="info">
						<div class="tabbable tabs-left">
							<ul class="nav nav-tabs">
								<li class="active"><a data-toggle="tab" href="#ainfo"><i
										class="icon-user"></i>基本信息</a>
								</li>
								<li class=""><a data-toggle="tab" href="#binfo"><i
										class="icon-wrench"></i>工作信息</a>
								</li>
								<li class=""><a data-toggle="tab" href="#cinfo"><i
										class="icon-info-sign"></i>修改密码</a>
								</li>
								<li class=""><a data-toggle="tab" href="#dinfo"><i
										class="icon-pencil"></i>联系方式</a>
								</li>
							</ul>
							<div class="tab-content">
								<div id="ainfo" class="tab-pane active">
									<form enctype="multipart/form-data" id="avatarForm" class="form-horizontal" action="avatarUpload.json" method="post">
										<div class="control-group">
											<div class="controls">
												<div class="avatar-img init-imgstyle"><img id="user-avatar" src="${path}/avatar?id=<%=SecurityUtils.getCurrentUser().getId()%>_200"></div>
												<div id="container">
													<p>大尺寸头像：200 像素  x 200 像素</p>
													<span class="btn btn-mini avatar-upload" id="uploadimage" >
													 	<span>选择图片</span>
													</span>
													<span class="btn btn-mini avatar-upload save-avatar" id="saveavatar" >
													 	<span>保存截取</span>
													</span>
													<span class="btn btn-mini avatar-upload cancel-avatar" id="cancelavatar" >
													 	<span>取消编辑</span>
													</span>
												</div>
											</div>
										</div>
									</form>
									<div class="preview-avatar" id="preview-avatar"></div>
									<form class="form-horizontal">
										<div class="userItem">
										   <c:if test="${not empty user.email}">
										       <div class="control-group">
												<label class="control-label">Email:</label>
												<div class="controls">
													<span class="email-text">${user.email}</span>
												</div>
												<input type="hidden" name="email" value="${user.email}">
											    </div>
										   </c:if>
										   <c:if test="${not empty user.mobile}">
										       <div class="control-group">
												<label class="control-label">手机:</label>
												<div class="controls">
													<span class="mobile-text">${user.mobile}</span>
												</div>
												<input type="hidden" name="mobile" value="${user.mobile}">
											    </div>
										   </c:if>
											<div class="control-group">
												<label for="nickname" class="control-label">昵称:</label>
												<div class="controls">
													<input type="text" name="nickname" class="text"
														id="nickname" placeholder="请输入昵称..."
														value="${user.nickname}" maxlength="20">
												</div>
											</div>

											<div class="control-group">
												<label for="realname_str" class="control-label">真实姓名:</label>
												<div class="controls">
													<input type="text" name="realname" class="text"
														id="realname_str" placeholder="请输入您的真实姓名..."
														value="${user.realname}">
												</div>
											</div>
											<div class="control-group">
												<label class="control-label">性别</label>
												<div class="controls">
													<label class="radio inline"> <input type="radio"
														value="0" id="male" name="gender" checked
														data-value="${user.gender}"> 男 </label> <label
														class="radio inline"> <input type="radio"
														value="1" id="fmale" name="gender"> 女 </label>
												</div>
											</div>
											<div class="control-group">
												<label class="control-label">出生年月:</label>
												<div class="controls">
													<select id="year" name="year" style="width: 71px" data-value="${year }"></select>
													<select id="month" name="month" style="width: 71px" data-value="${month }"></select>
													<select id="day" name="day" style="width: 71px" data-value="${day }"></select>
												</div>
												<input type="hidden" id="birthday" name="YearMonthDay" value="">
											</div>
											<div class="control-group">
												<label for="add_str" class="control-label">街道地址:</label>
												<div class="controls">
													<input type="text" id="add_str" name="address.address" placeholder="请输入您的街道地址..." value="${user.address.address}" />
												</div>
											</div>
											<div class="control-group">
												<label for="add_city" class="control-label">所在城市:</label>
												<div class="controls">
													<select class="user_city" id="add_city" style="width: 108px" name="address.city" data-value="${user.address.city}">
														<option value="-1">--请选择--</option>
														<option value="11">北京</option>
														<option value="12">天津</option>
														<option value="13">河北</option>
														<option value="14">山西</option>
														<option value="15">内蒙</option>
														<option value="16">辽宁</option>
														<option value="17">吉林</option>
														<option value="18">黑龙江</option>
														<option value="19">上海</option>
														<option value="20">江苏</option>
														<option value="21">浙江</option>
														<option value="22">安徽</option>
														<option value="23">福建</option>
														<option value="24">江西</option>
														<option value="25">山东</option>
														<option value="26">河南</option>
														<option value="27">湖北</option>
														<option value="28">湖南</option>
														<option value="29">广东</option>
														<option value="30">广西</option>
														<option value="31">海南</option>
														<option value="32">深圳</option>
														<option value="33">四川</option>
														<option value="34">贵州</option>
														<option value="35">云南</option>
														<option value="36">西藏</option>
														<option value="37">重庆</option>
														<option value="38">陕西</option>
														<option value="39">甘肃</option>
														<option value="40">青海</option>
														<option value="41">宁夏</option>
														<option value="42">新疆</option>
														<option value="43">其他</option>
													</select> 
													<select class="subcity" style="width: 108px" id="add_scity" name="address.scity" data-value="${user.address.scity}">
														<option value="-1">--请选择--</option>
													</select>
												</div>
											</div>
											<div class="form-actions">
												<button class="btn btn-primary" type="submit">保存</button>
											</div>
										</div>
									</form>
								</div>
								<div id="binfo" class="tab-pane">
									<form class="form-horizontal">
										<div class="userItem">
											<div class="control-group">
												<label for="company_str" class="control-label">公司:</label>
												<div class="controls">
													<input type="text" id="company_str" name="company.company" placeholder="请输入公司信息..." value="${user.company.company}" />
												</div>
											</div>
											<div class="control-group">
												<label for="com_address_city" class="control-label">所在城市:</label>
												<div class="controls">
													<select class="user_city" id="com_address_city" style="width: 108px" name="company.address.city" data-value="${user.company.address.city}">
														<option value="-1">--请选择--</option>
														<option value="11">北京</option>
														<option value="12">天津</option>
														<option value="13">河北</option>
														<option value="14">山西</option>
														<option value="15">内蒙</option>
														<option value="16">辽宁</option>
														<option value="17">吉林</option>
														<option value="18">黑龙江</option>
														<option value="19">上海</option>
														<option value="20">江苏</option>
														<option value="21">浙江</option>
														<option value="22">安徽</option>
														<option value="23">福建</option>
														<option value="24">江西</option>
														<option value="25">山东</option>
														<option value="26">河南</option>
														<option value="27">湖北</option>
														<option value="28">湖南</option>
														<option value="29">广东</option>
														<option value="30">广西</option>
														<option value="31">海南</option>
														<option value="32">深圳</option>
														<option value="33">四川</option>
														<option value="34">贵州</option>
														<option value="35">云南</option>
														<option value="36">西藏</option>
														<option value="37">重庆</option>
														<option value="38">陕西</option>
														<option value="39">甘肃</option>
														<option value="40">青海</option>
														<option value="41">宁夏</option>
														<option value="42">新疆</option>
														<option value="43">其他</option>
													</select>
													<select class="subcity" id="com_address_scity" style="width: 108px" name="company.address.scity" data-value="${user.company.address.scity}">
														<option value="-1">--请选择--</option>
													</select>
												</div>
											</div>
											<div class="control-group">
												<label for="position_str" class="control-label">职位:</label>
												<div class="controls">
													<input type="text" id="position_str" name="company.position" placeholder="请输入职业信息..." value="${user.company.position}" />
												</div>
											</div>
											<div class="control-group">
												<label for="job_category" class="control-label">工作性质:</label>
												<div class="controls">
													<select id="job_category" name="company.jobCategory"
														data-value="${user.company.jobCategory}">
														<option selected="" value="-1">--请选择--</option>
														<option value="1">设计</option>
														<option value="2">施工</option>
														<option value="3">造价</option>
														<option value="4">审计</option>
														<option value="5">监理</option>
														<option value="6">运维</option>
														<option value="7">采购</option>
														<option value="8">其它</option>
													</select>
												</div>
											</div>
											<div class="control-group">
												<label for="industry_str" class="control-label">所在行业:</label>
												<div class="controls">
													<input type="text" id="industry_str"
														name="company.industry" placeholder="请选择您所在行业信息..."
														value="${user.company.industry}" readonly="readonly"/>
												</div>
											</div>
											<div class="form-actions">
												<button class="btn btn-primary" type="submit">保存</button>
											</div>
										</div>
									</form>
								</div>
								<div id="cinfo" class="tab-pane">
									<form class="form-horizontal">
										<div class="userItem">
											<div class="control-group">
												<label for="opassword" class="control-label">旧密码:</label>
												<div class="controls">
													<input type="password" name="opassword" class="text"
														id="opassword" placeholder="请输入旧密码" autocomplete="off" maxlength="16"><span
														id="opassword_error"></span>
												</div>
											</div>
											<div class="control-group">
												<label for="npassword" class="control-label">新密码:</label>
												<div class="controls">
													<input type="password" name="npassword"
														class="input-large focused" id="npassword"
														placeholder="请输入新密码" autocomplete="off" maxlength="16"><span
														id="npassword_error"></span>
												</div>
											</div>
											<div class="control-group">
												<label for="cpassword" class="control-label">新密码:</label>
												<div class="controls">
													<input type="password" name="cpassword"
														class="input-large focused" id="cpassword"
														placeholder="请确认新密码" autocomplete="off" maxlength="16"> <span
														id="resetpwd_error"></span>
												</div>
											</div>
											<div class="controls">
                                             	<p>密码为 6-16 位字符（字母、数字、字符），区分大小写</p>
                                             	<div class="password-power">密码强度 <span class="empty"></span><span class="empty"></span><span class="empty"></span><span class="empty"></span></div>
                                            </div>
											<div class="form-actions">
												<button class="btn btn-primary" type="submit">保存</button>
											</div>
										</div>
									</form>
								</div>
								<div id="dinfo" class="tab-pane">
									<form class="form-horizontal">
										<div class="userItem">
											<div class="control-group">
												<label for="city_str" class="control-label">联系地址</label>
												<div class="controls">
													<input type="text" id="city_str"
														name="contact.address.address" placeholder="请输入联系地址"
														value="${user.contact.address.address}" />
												</div>
											</div>
											<div class="control-group">
												<label for="zipcode_str" class="control-label">邮政编码:</label>
												<div class="controls">
													<input type="text" id="zipcode_str"
														name="contact.address.zipcode" placeholder="请输入邮政编码..."
														value="${user.contact.address.zipcode}" maxlength="6"/><span
														id="zipcode_error"></span>
												</div>
											</div>
											<div class="control-group">
												<label for="phone_str" class="control-label">座机:</label>
												<div class="controls">
													<input type="text" id="phone_str" name="contact.phone"
														placeholder="请输入座机号码，例如02165351212..."
														value="${user.contact.phone}" />
														<span id="phone_error"></span>
												</div>
											</div>
											<div class="control-group">
												<label for="tel_str" class="control-label">手机:</label>
												<div class="controls">
													<input type="text" id="tel_str" name="contact.tel"
														placeholder="请输入手机..." value="${user.contact.tel}" maxlength="11" /><span
														id="tel_error"></span>
														<span id="tel_error"></span>
												</div>
											</div>
											<div class="form-actions">
												<button class="btn btn-primary" type="submit">保存</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>

					<div id="myspace" class="tab-pane fade in">							
						<div class="auth_content">
							<span class="badge badge-info">我的应用</span>
							<c:forEach var="data" items="${datas}">
								<div class="row fieldset" style="margin-left: 0">
									<div class="span10">${ data.name }</div>
									<div class="span2">
										<button class="btn btn-danger unauth" data-id=${ data.id }>取消授权</button>
									</div>
								</div>
							</c:forEach>
							<c:forEach var="data" items="${oauth2Info}">
								<div class="row fieldset" style="margin-left: 0">
									<div class="span3">${ data.consumerId }</div>
									<div class="span4">${ data.expiration }</div>
									<div class="span3">${ data.scope }</div>
									<div class="span2">
										<button class="btn btn-danger unauth" data-id=${ data.value }>取消授权</button>
									</div>
								</div>
							</c:forEach>
						</div>
					</div>
					
					<div id="linkMan" class="tab-pane fade in">
						<div class="fieldset">
							<table class="table table-hover">
				              <thead>
				                <tr>
				                  <th><input type="checkbox" id="toggle-all"></th>
				                  <th></th>
				                  <th></th>
				                  <th id="add-contact"><a class="btn btn-small">添加联系人</a></th>
				                  <th id="clear-completed"><a class="btn btn-small">批量删除</a></th>
				                </tr>
				              </thead>
				              <tbody id="contact-body">
				              </tbody>
				            </table>
			            </div>
					</div>
					
					<div id="organization" class="tab-pane fade in">
						<div id="organization-wrap">
							<div id="organization-head" class="navbar navbar-static-top">
								<div id="menu" class="navbar-inner">
									<div class="container">
										<a class="brand" href="#">我的组织</a>
										<ul class="nav-divider">
											<li class="divider-vertical"></li>
									    </ul>
										<ul class="nav">
									        <li id="add_organization"><a href=#>添加组织</a></li>
										    <li id="add_institution"><a href=#>添加机构</a></li>
											<li id="add_user"><a href=#>添加人员</a></li>
											<li id="rename"><a href=#>重命名</a></li>
											<li id="remove"><a href=#>删除</a></li>
									    </ul>
									    <form class="navbar-search pull-right">
									    	<div class="input-append">
								              <input type="text" class="span3" placeholder="Search" id="textInput">
								              <button type="button" class="btn" id="text">查找</button>
								              <button type="button" class="btn" id="clear_search">删除</button>
								            </div>
					                    </form>
									</div>
								</div>
							</div>
							<div id="organization-left">
								
							</div>
							<div id="organization-right">
								<div class="row-fluid">
						            <div class="thumbnails">
							              
						            </div>
						        </div>
							</div>
						</div>
					</div>
					
				</div>
			</div>
			
			<div id="addUser_dlg" class="hide fade in normal-modal">
				<div class="modal-wrap">
					<div class="modal-header">
						<button data-dismiss="modal" class="close" type="button"></button>
						<h3>添加成员</h3>
					</div>
					<div class="modal-body">
						<div class="body_wrap">
						    <div class="control-group">
								<p class="control-label">
									<span>请输入您想添加用户的email:</span>
								</p>
								<div class="controls">
									<input class="span6" id="orgUser-input" type="text" placeholder="按回车确认添加">
								</div>
							</div>
							<div class="control-group">
								<div class="error-msg"></div>
							</div>
							<div class="control-group">
								<p class="control-label">
									<span>请选择您要添加的人员列表:</span>&nbsp;&nbsp;<span><input type="checkbox" id="select_all"/></span>
								</p>
								<div id="orgUser">
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary" id="add_ok">确定</button>
						<button data-dismiss="modal" class="btn" >取消</button>
					</div>
				</div>
			</div>
			<div id="update_dlg" class="hide fade in normal-modal">
				<div class="modal-wrap">
					<div class="modal-header">
						<button data-dismiss="modal" class="close" type="button"></button>
						<h3>修改联系人信息</h3>
					</div>
					<div class="modal-body">
						<div class="form-horizontal">
							<div class="control-group">
								<label for="contact_nick" class="control-label"><strong>备注</strong></label>
								<div class="controls">
									<input type="text" placeholder="备注" id="contact_nick" >
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary">确定</button>
						<button data-dismiss="modal" class="btn" >取消</button>
					</div>
				</div>
			</div>
			<div id="add_dlg" class="hide fade in normal-modal">
				<div class="modal-wrap">
					<div class="modal-header">
						<button data-dismiss="modal" class="close" type="button"></button>
						<h3>添加联系人</h3>
					</div>
					<div class="modal-body">
						<div class="form-horizontal">
							<div class="control-group">
								<label for="contact_email" class="control-label"><strong>账号</strong></label>
								<div class="controls">
									<input type="text" placeholder="email / 手机号" id="contact_email" >
									<span style="color:red;display: none;">该用户不存在</span>
								</div>
							</div>
							<div class="control-group">
								<label for="contact_name" class="control-label"><strong>备注</strong></label>
								<div class="controls">
									<input type="text" placeholder="备注" id="contact_name" >
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary">确定</button>
						<button data-dismiss="modal" class="btn" >取消</button>
					</div>
				</div>
			</div>
			<div id="delete_dlg"  class="hide fade in normal-modal">
				<div class="modal-wrap">
					<div class="modal-header">
						<button data-dismiss="modal" class="close" type="button"></button>
						<h3>确认删除</h3>
					</div>
					<div class="modal-body">
						您确定要删除此项吗?
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary" id="fdelete">确定</button>
						<button data-dismiss="modal" class="btn" >取消</button>
					</div>
				</div>
			</div>
			
			<div id="feedback_dlg" class="modal fade in feedback_dialog hide">
					<iframe frameborder=0 width=100% height="330px" scrolling="no" src='${path}/contactus' border=none></iframe>
			</div>
			
			<%@ include file="footer.jsp"%>
		</div>
		<script>
			window.rootPath = "${path}";
			window.uid = "<%=SecurityUtils.getCurrentUser().getId()%>";
		</script>
		<script src="${path}/js/userinfo.min.js"></script>
	</body>
</html>
